package com.slz3.business.module.systemManagement.sysRoleUser.steward;

import com.slz3.business.module.systemManagement.sysRoleUser.domain.SysRoleUser;
import com.slz3.business.module.systemManagement.sysRoleUser.domain.SysRoleUserCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

@Component
public class SysRoleUserResponse {

    @Resource
    private SysRoleUserResController sysRoleUserResController;

    public  Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(SysRoleUser.class).flatMap(sysRoleUser ->
                sysRoleUserResController.add(req, sysRoleUser)
        );
    }

    public  Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(SysRoleUserCondition.class).flatMap(sysRoleUserCondition ->
                sysRoleUserResController.delete(req, sysRoleUserCondition)
        );
    }

    public  Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(SysRoleUser.class).flatMap(sysRoleUser ->
                sysRoleUserResController.modify(req, sysRoleUser)
        );
    }


    public  Mono<ServerResponse> list(ServerRequest req) {
        return sysRoleUserResController.list(req);
    }

    public  Mono<ServerResponse> info(ServerRequest req) {
        return sysRoleUserResController.info(req);
    }

    public  Mono<ServerResponse> choice(ServerRequest req) {
        return sysRoleUserResController.choice(req);
    }

    public  Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(SysRoleUserCondition.class).flatMap(sysRoleUserCondition ->
                sysRoleUserResController.auditSubmit(req, sysRoleUserCondition)
        );
    }

    public  Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(SysRoleUserCondition.class).flatMap(sysRoleUserCondition ->
                sysRoleUserResController.audit(req, sysRoleUserCondition)
        );
    }

    public  Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(SysRoleUserCondition.class).flatMap(sysRoleUserCondition ->
                sysRoleUserResController.auditReject(req, sysRoleUserCondition)
        );
    }

    public  Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(SysRoleUserCondition.class).flatMap(sysRoleUserCondition ->
                sysRoleUserResController.usingEnable(req, sysRoleUserCondition)
        );
    }

    public  Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(SysRoleUserCondition.class).flatMap(sysRoleUserCondition ->
                sysRoleUserResController.usingDisable(req, sysRoleUserCondition)
        );
    }   

}
